package fleditor.view.assetView
{
	import flash.events.Event;
	import fleditor.controller.FlEditorController;
	import fleditor.model.FlEditorModel;
	import ui.asset.assetListUI;

	/**
	 *物件单项列表 
	 * @author Devin
	 * 
	 */	
	public class AssetListView extends assetListUI
	{
		/**
		 *全局Model类(FlEditModel)
		 */		
		private var _model:FlEditorModel;
		
		/**
		 *全局控制器(FlEditorController) 
		 */		
		private var _controller:FlEditorController;
		
		/**
		 *物件单项列表 
		 * @param controller 全局控制器(FlEditorController) 
		 * @param model 全局Model类(FlEditModel)
		 */		
		public function AssetListView(controller:FlEditorController, model:FlEditorModel)
		{
			_controller=controller;
			_model=model;
			
			setView();
			setEvent();
		}
		
		/**
		 *设置视图 
		 * 
		 */		
		private function setView():void
		{
			
		}
		
		/**
		 *设置事件 
		 * 
		 */		
		private function setEvent():void
		{
			addEventListener(Event.ADDED_TO_STAGE, __onAddedToStage);//当前视图增加到舞台后事件监听
		}
		
		/**
		 *设置单项物件列表 
		 * 
		 */		
		private function setAssetCellList():void
		{
			
		}
		
		/**
		 *当前视图增加到舞台后 
		 * @param evt
		 * 
		 */		
		private function __onAddedToStage(evt:Event):void
		{
			stage.addEventListener(Event.RESIZE, __onResize);//窗口大小变化监听
			resetUI();
		}
		
		/**
		 * 窗口发生变化时 
		 * @param evt
		 * 
		 */		
		private function __onResize(evt:Event):void
		{
			resetUI();
		}
		
		/**
		 *设置UI 
		 * 
		 */		
		private function resetUI():void
		{
			graphics.clear();
			graphics.beginFill(0xE1E1E1);
			graphics.drawRect(0, 0, width, stage.stageHeight-90-3);
			graphics.lineStyle(1, 0x8c8c8c);
			graphics.moveTo(width, 0);
			graphics.lineTo(width, stage.stageHeight-90-3);//stage.stageHeight-90-3=舞台高-顶部高度-底部边框高度
			graphics.endFill();
		}
	}
}